﻿using System;
using System.Collections.Generic;
using System.Text;

namespace MandoGroup.TFSIntegration.Entities
{
    [Serializable]
    public class MGWorkItem
    {
        public int Id { get; set; }
        public string Title { get; set; }
        public double ItemEstimate { get; set; }
        public double ChildrenEstimate { get; set; }
        public double TotalEstimate
        {
            get { return ItemEstimate + ChildrenEstimate; }
        }
        public List<int> ChildWorkItemIds { get; set; }
        public string DisplayableChildWorkItemIds
        {
            get
            {
                StringBuilder sb = new StringBuilder();
                foreach (var childWorkItemId in ChildWorkItemIds)
                {
                    sb.Append(childWorkItemId);
                    sb.Append(",");
                }

                return sb.ToString();
            }
        }
    }
}
